home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Libris Britannia 4
/
science library(b).zip
/
science library(b)
/
ELECTRON
/
1009.ZIP
/
HAM1.ARC
/
INTERMOD.BAS
< prev
next >
Wrap
BASIC Source File
|
1986-05-23
|
1KB
|
62 lines
10 REM INTERMOD FREQUENCY CALCULATION
20 REM J M HOWELL
30 CLS
40 PRINT
50 PRINT TAB(5);"INTERMODULATION PRODUCTS"
60 PRINT
70 PRINT"HOW MANY SIGNALS?"
80 INPUT NS
90 IF NS<2 OR NS>4 THEN GOTO 70
100 PRINT"ENTER THE FREQUENCIES"
110 IF NS=2 THEN INPUT F1,F2
120 IF NS=3 THEN INPUT F1,F2,F3
130 IF NS=4 THEN INPUT F1,F2,F3,F4
140 PRINT"ENTER OBSERVED FREQUENCY RANGE"
150 INPUT FA,FB
160 IF FA>FB THEN GOTO 140
170 PRINT"HIGHEST ORDER PRODUCT"
180 INPUT H
190 IF H<1 THEN GOTO 170
200 IF NS=2 THEN T=6+3*H
210 IF NS=3 THEN T=7+H*(6+H*2)
220 IF NS=4 THEN T=8+H*(8+H*(4+H))
230 PRINT"THIS WILL TAKE ABOUT ";INT(T*H/90)+1 " SECONDS"
240 FL=0
250 FK=0
260 FOR G=1 TO H
270 PRINT
280 PRINT"ORDER = ";G
290 LET JM=G
300 LET KM=G
310 ON NS-1 GOSUB 500,440,380
320 NEXT G
330 PRINT
340 PRINT"CALCULATION COMPLETE - RUN AGAIN? (Y/N)"
350 INPUT A$
360 IF A$="Y" THEN GOTO 30
370 STOP
380 FOR L=-G TO G
390 FL=F4*L
400 KM=G-ABS(L)
410 GOSUB 440
420 NEXT L
430 RETURN
440 FOR K=-KM TO KM
450 FK=FL+K*F3
460 JM=KM-ABS(K)
470 GOSUB 500
480 NEXT K
490 RETURN
500 FOR J=-JM TO JM
510 I=JM-ABS(J)
520 F=FK+J*F2+I*F1
530 IF FA>ABS(F) OR ABS(F)>FB THEN GOTO 600
540 IF F=0 OR I=0 AND F<0 THEN GOTO 600
550 Z=ABS(F)/F
560 PRINT Z*F;TAB(15);Z*I;TAB(19);Z*J;
570 IF NS>2 THEN PRINT TAB(23);Z*K;
580 IF NS=4 THEN PRINT TAB(27);Z*L;
590 PRINT
600 NEXT J
610 RETURN